package com.web.sdk.genericClass;

import com.web.sdk.bean.BExceptionDescription;
import com.web.sdk.bean.JsonMessage;

/**
 * <p>ClassName    GenericController</p>
 * <p>Description  逻辑控制层  </p>
 * <p>CopyRight(c) 2016/1/4</p>
 * <p>Company      liansheng</p>
 *
 * @author yiyongyao
 * @version 1.0.0
 */
public class GenericController {

    /**
     * 根据定义的enumEntity异常实体,返回异常信息
     * @param enumEntity  异常自定义枚举类
     * @return JsonMessage 异常信息封装实体
     */
    public JsonMessage getJsonMessage(BExceptionDescription enumEntity) {
        JsonMessage jsonMessage = new JsonMessage();
        jsonMessage.setCode(enumEntity.getCode());
        jsonMessage.setErrorMessage(enumEntity.getErrorMessage());
        return jsonMessage;
    }

}

